/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modulo1.cgd;

import java.util.List;
import javax.persistence.Query;
import modulo1.cdp.Curso;

/**
 *
 * @author Juan
 */
public class CursoDaoJpa extends DaoJpa<Curso> {
    public List<Curso> buscarNome(String nome) throws Exception {
        try {
                Query q = em.createQuery("SELECT c FROM Curso c WHERE LOWER(c.nome) LIKE LOWER('"+nome+"%') ");
            return q.getResultList();
        }
        catch (Exception ex) {
            throw ex;
        }
    } 
}
